package interview.javabase.thread.threadpool;

import static java.lang.Thread.currentThread;

@SuppressWarnings("all")
class MyTask implements Runnable {

    private int taskNum;

    public MyTask(int num) {
        this.taskNum = num;
    }

    @Override
    public void run() {
        System.out.println("线程名称：" + currentThread().getName() + "，正在执行task " + taskNum);
        try {
            currentThread().sleep(4000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("task " + taskNum + "执行完毕");
    }
}